package com.lzc.springcloud.zuul.config;

import com.lzc.springcloud.zuul.filter.HeaderFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FilterConfigurer {

    @Bean
    HeaderFilter headerFilter() {
        return new HeaderFilter();
    }

    @Bean
    public FilterRegistrationBean filterRegistrationBean() {
        FilterRegistrationBean registrationBean = new FilterRegistrationBean();
        registrationBean.setFilter(headerFilter());
        registrationBean.setOrder(0);
        return registrationBean;
    }
}
